package org.hilo.boot.core.value;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
 * auto init value
 * 
 * @author zollty
 * @since 2018-03-20
 */
@Target({FIELD})
@Retention(RUNTIME)
public @interface AutoValue {
    
    /**
     * value parser
     */
    Class<?> parser() default Object.class;
    
    /**
     * default value
     */
    String value() default "";
    
    /**
     * 数据库的操作类型
     * <p> ADD = 0;
     * <p> UPDATE = 1;
     * <p> ANY = 2
     * 
     * @see ActionType
     */
    int action() default ActionType.ADD;
    
    /**
     * 设置值的策略
     * <p> WHEN_NULL = 0;
     * <p> ALWAYS = 1;
     * <p> CANT_BE_NULL = 2;
     * 
     * @see StrategyType
     */
    int strategy() default StrategyType.WHEN_NULL;

}
